<?php
	include "class/cart.php";
	include "config.php";
	
	if(isset($_REQUEST['tambah']) && $_REQUEST['productid']>0){
		//echo "fsdfsfsfsd";
		//echo $_REQUEST['productid'];

		$pid=$_REQUEST['productid'];
		//echo $pid;
		$cart=new Cart();
		$cart->addtocart($pid,1);
		header ("location:?menu=shoppingcart");
		exit();
	}
?>
<style type="text/css">
<!--
a:link {
	color: #000000;
}
a:visited {
	color: #000000;
}
a:hover {
	color: red;
}
a:active {
	color: red;
}
-->
</style>
<div align="center">
<table width=100%><tr><td>
<ul class="nav">
<table width=80% align=center><tr><td align=center height=29><font color=#FFFFFF>Detil Produk</font></td></tr></table>
</ul></tr></table>
<?php
require_once "config/koneksi.php";
require_once "class/produk.php";
require_once "class/toko.php";
if (ISSET($_GET["id_oleh2"])){
$id_oleh2=$_GET["id_oleh2"];
}
$Produk_Dao = new Produk_Dao();
$produk=$Produk_Dao->get($_GET["id_oleh2"]);
$Toko_Dao=new Toko_Dao();
$toko=$Toko_Dao->get($produk->id_toko);


?>
<form name="form1" method=post >
	<input type="hidden" name="productid" />
    <input type="hidden" name="command" />
</form>
  <table width=30% border=0 bordercolor=#FFFFFF align=left>
    <tr valign=middle bordercolor=#FFFFFF> 
      <td width=15% align=right></td>
      <td width=5></td>
		<div align=left><font size=4 face=tahoma color=#000000><?php echo $produk->nama_oleh2?></font></div>
    </tr>
	<div id="divContent"> 
            <table width=300 align=center border=1 cellspacing=0>
			<tr><td align=center valign=top width=100% height=16>
    <tr bordercolor=#FFFFFF> 
      <td width=200 height=189 valign=top nowrap align=right><font color=#FF9900><img src="<?php echo "images/gambar_produk/".$produk->gambar;?>"  width="200" height="225"></td>
      <td width=5>&nbsp;</td>
      <td width=320 valign=top nowrap><font color=#FF9900></font>
        <div align=left> 
          <table width=100% border=0>
            <tr valign=top> 
              <td colspan=4 rows=7> <hr align=right width=100% size=2 noshade color=#cccccc> 
                <font size=2 face=tahoma><?php echo $produk->detil?></font></td>
            </tr>
            <tr valign=top> 
              <td width=50%><font size=2 face=tahoma>Kode Produk</font></td>
              <td width=0%>:</td>
              <td width=79%><font face=tahoma size=2><?php echo $produk->id_oleh2 ?></font></td>
            </tr>
            <tr valign=top> 
              <td><font size=2 face=tahoma>Harga</font></td>
              <td>:</td>
              <td><font size=2 face=tahoma>Rp. <?php echo $produk->harga ?></font></td>
            </tr>
			<tr valign=top> 
              <td><font size=2 face=tahoma>Toko</font></td>
              <td>:</td>
              <td><font size=2 face=tahoma><?php echo $toko->nama_toko?></font></td>
            </tr>
          </table>
          <hr align=right width=100% size=2 noshade color=#cccccc>
          <p align=right> 
		  <form method="post" action="<?php echo '?menu=view_produkdetil&&id_oleh2='.$produk->id_oleh2; ?>">
		  <input type="hidden" name="productid" value="<?php echo $produk->id_oleh2; ?>"/>
          <input type="submit" name="tambah" value="Tambah Keranjang"></input>
		  </form>
          </p>
        </div></th>
    </tr>
  </table>
 <br> 
 <?php include("komentar.php") ?>